Video Playing Control Method, Terminal Device, Server, and Storage Medium

ABSTRACT

A video playing control method includes obtaining a video playing policy, where the video playing policy determines information about a control algorithm used for video playing, determining according to the video playing policy, a target control algorithm used for video playing, downloading and playing a video by using the target control algorithm, collecting video playing quality indicator data in a process of downloading and playing the video, and uploading the quality indicator data to a server, to indicate the server to adjust the video playing policy based on the quality indicator data.

This application claims priority to Chinese Patent Application No.201911317023.4, filed with the China National Intellectual PropertyAdministration on Dec. 19, 2019 and entitled “VIDEO PLAYING CONTROLMETHOD, TERMINAL DEVICE, SERVER. AND STORAGE MEDIUM”, which isincorporated herein by reference in its entirety.

TECHNICAL FIELD

This application belongs to the field of computer technologies, and inparticular, to a video playing control method, a terminal device, aserver, and a storage medium.

BACKGROUND

Currently, to improve an online video playing effect, a preset adaptivecontrol algorithm is usually used to play a video. For example, a properresolution and video playing start bit rate can be selected based onchange of a user network bandwidth, or a bit rate can be adjusted duringvideo playing, to ensure that video playing starts quickly, the video issmoothly played without freeze.

However, each parameter of an existing control algorithm is usuallystatic empirical data obtained by testing a network model in alaboratory. Each quality indicator of video playing cannot be consideredin a complex and changeable network condition. For example, if a playingstart delay is short and zero freeze is required, a video bitstream witha low resolution and bit rate needs to be selected, but video playingdefinition is poor. If a video bitstream with a high resolution and bitrate is selected, the video playing definition is good, but the playingstart delay is long and a freeze rate is high.

SUMMARY

In view of this, embodiments of this application provide a video playingcontrol method, a terminal device, a server, and a storage medium, so asto take into consideration all quality indicators of video playing, andachieve a better video playing effect.

According to a first aspect, an embodiment of this application providesa video playing control method, including:

A terminal device obtains a video playing policy, where the videoplaying policy is used to determine information about a controlalgorithm used for current video playing.

The terminal device determines, according to the video playing policy, atarget control algorithm used for current video playing.

The terminal device downloads and plays a video by using the targetcontrol algorithm.

The terminal device collects video playing quality indicator data in aprocess of downloading and playing a video.

The terminal device uploads the quality indicator data to a server, toindicate the server to adjust the video playing policy based on thequality indicator data.

When playing the video online, the terminal device obtains the videoplaying policy, determines, according to the video playing policy, thecontrol algorithm set for a player, and controls downloading and playingof the video by using the control algorithm. In addition, during theprocess of downloading and playing the video, the player collects thevideo playing quality indicator data in real time and reports the datato the server. The server may receive the quality indicator datauploaded by a plurality of different terminal devices when a video isplayed, and perform big data analysis processing, so as to determinewhether a current video playing policy can take into consideration eachquality indicator of video playing and whether better video playingquality can be obtained. If the current video playing policy cannot meetthe requirement, the server may adjust the video playing policy, forexample, use a new control algorithm or adjust parameters of an originalcontrol algorithm, so as to implement adaptive adjustment of the controlalgorithm. All quality indicators of video playing can be considered toachieve better video playing effect.

In a possible implementation of the first aspect, the determining, bythe terminal device according to the video playing policy, a targetcontrol algorithm used for current video playing may include:

The terminal device obtains a device type of the terminal device.

The terminal device selects, according to the video playing policy, acontrol algorithm corresponding to the device type from a plurality ofpreset control algorithms as the target control algorithm.

For different types of terminal devices, different control algorithmsmay be used to control video playing, so as to achieve a better videoplaying effect. For example, mobile phones have low requirements onvideo definition and a bit rate, and high requirements on a playingstart delay and playing smoothness. A large-screen TV has a highrequirement on the viewing definition and a low requirement on theplaying start delay. Therefore, for the mobile phone device, a controlalgorithm that can implement the low playing start delay and highplaying smoothness may be selected. For large-screen TV devices, acontrol algorithm that can realize high-definition playing can beselected.

In a possible implementation of the first aspect, the determining, bythe terminal device according to the video playing policy, a targetcontrol algorithm used for current video playing may include:

The terminal device receives a first control algorithm delivered by theserver.

The terminal device determines a version number of video playingsoftware used for video playing.

The terminal device searches locally or from the server for a presetsecond control algorithm associated with the version number.

The terminal device selects the target control algorithm from the firstcontrol algorithm and the second control algorithm according to thevideo playing policy.

When playing a video, the terminal device usually uses a default controlalgorithm, for example, a preconfigured control algorithm associatedwith the version number of the video playing software. The controlalgorithm (that is, the second control algorithm) may be stored locallyor in the server. In this embodiment of this application, the server maydeliver, to each terminal device, the control algorithm (that is, thefirst control algorithm) that can be flexibly adjusted and the videoplaying policy, and the terminal device determines, according to thevideo playing policy, that a default first control algorithm or thesecond control algorithm delivered by the server is used for currentvideo playing.

Further, the selecting, by the terminal device, the target controlalgorithm from the first control algorithm and the second controlalgorithm according to the video playing policy may include:

The terminal device obtains a historical record of each controlalgorithm used by the video playing software to play a video.

The terminal device determines an invocation ratio of the first controlalgorithm according to the video playing policy.

The terminal device selects a control algorithm from the first controlalgorithm and the second control algorithm based on the historicalrecord and the invocation ratio as the target control algorithm.

For example, it is determined, according to the video playing policy,that the invocation ratio of the first control algorithm is 3:7. In 10times of video playing initiated by the video playing software, thefirst control algorithm is used for three times, and the second controlalgorithm is used for seven times. Then, with reference to a record ofeach control algorithm used by the video playing software forhistorically playing a video, for example, control algorithms used forthe previous nine times, it may be determined that the first controlalgorithm or the second control algorithm is used for playing the videothis time.

Still further, the uploading, by the terminal device, the qualityindicator data to a server, to indicate the server to adjust the videoplaying policy based on the quality indicator data may include:

The terminal device uploads the quality indicator data to the server, toindicate the server to adjust the invocation ratio based on the qualityindicator data.

For example, the invocation ratio of the first control algorithm may berelatively low initially. In other words, a default relatively stablesecond control algorithm is more used. After receiving the uploadquality indicator data that is used by each terminal device to play thevideo by using the first control algorithm, the server may analyze thequality indicator data, and further determine a video playing effect ofthe first control algorithm. If it is found that the video playingeffect of the first control algorithm is better, the invocation ratio ofthe first control algorithm may be correspondingly increased, so as toimprove the overall video playing effect.

Further, after the collecting, by the terminal device, video playingquality indicator data, the method may further include:

If the target control algorithm is the first control algorithm, theterminal device uploads the quality indicator data to the server, toindicate the server to adjust the first control algorithm and parametersof the first control algorithm based on the quality indicator data.

A factor or a parameter of the first control algorithm may be flexiblyadjusted. Therefore, if the first control algorithm is used for currentvideo playing, the server may adjust the first control algorithm and theparameter of the first control algorithm based on the quality indicatordata uploaded by the terminal device. This improves the quality andeffect of video playing.

Further, after the collecting, by the terminal device, video playingquality indicator data, the method may further include:

If the target control algorithm is the first control algorithm and thequality indicator data meets a preset condition, the terminal devicecancels an association relationship between the second control algorithmand the version number, and associates the first control algorithm withthe version number.

After receiving the upload quality indicator data that is used by eachterminal device to play the video by using the first control algorithm,the server may analyze the quality indicator data, and further determinea video playing effect of the first control algorithm. If the qualityindicator data meets a preset condition, it indicates that the videoplaying effect is relatively good and is better than that of the defaultsecond control algorithm. In this case, the association relationshipbetween the second control algorithm and the version number may becanceled, and the first control algorithm is associated with the versionnumber. The default control algorithm for subsequent video playing isupdated to the first control algorithm.

Further, after the uploading, by the terminal device, the qualityindicator data to a server, the method may further include.

The terminal device uploads information about the selected targetcontrol algorithm to the server, so as to indicate the server to analyzethe quality indicator data based on the information about the selectedtarget control algorithm, and generates a video playing qualityindicator of the first control algorithm and a video playing qualityindicator of the second control algorithm.

For example, terminal devices A, B, and C play a video by using thefirst control algorithm, and upload respective video playing qualityindicator data to the server. Terminal devices R, S, T . . . play thevideo by using the second control algorithm, and upload the respectivevideo playing quality indicator data to the server. The server performsbig data analysis based on the received quality indicator data of eachterminal device and the information about the used control algorithm,and may generate the video playing quality indicator of the firstcontrol algorithm and the video playing quality indicator of the secondcontrol algorithm. The video playing effect of different controlalgorithms can be viewed intuitively by relevant personnel.

In a possible implementation of the first aspect, in a process ofdownloading and playing a video by the terminal device, the method mayfurther include:

The terminal device detects a current network download rate.

If the network download rate exceeds a first threshold, the terminaldevice obtains a video segment that has been buffered in a local buffer.

If a resolution of the buffered video segment is less than a secondthreshold and/or a bit rate is less than a third threshold, the terminaldevice downloads a video segment whose resolution is greater than orequal to the second threshold and whose bit rate is greater than orequal to the third threshold in a same time period; and replaces thebuffered video segment.

In the process of downloading and playing the video, if a currentnetwork download rate is relatively high, a video segment that has beencached in a local buffer may be detected. If a resolution/bit rate ofthe cached video segment is relatively low, content with a higherresolution or bit rate in the same time period may be selected to bedownloaded, and content in the local buffer is replaced, so as toresolve a problem that a user has poor viewing definition due todownloading content with a low resolution or a bit rate due to a networkspeed or a buffer watermark.

In another possible implementation of the first aspect, the proposedvideo playing control method includes:

After receiving a video playing request sent by a terminal device, aserver sends a video playing policy to the terminal device, so as toindicate the terminal device to determine, according to the videoplaying policy, a target control algorithm used for current videoplaying, and download and play a video by using the target controlalgorithm, where the video playing policy is used to determineinformation about a control algorithm used for current video playing.

The server receives video playing quality index data uploaded by theterminal device, where the quality index data is obtained by theterminal device through collection in a process of downloading andplaying a video.

The server adjusts the video playing policy according to the qualityindicator data.

The server may receive the quality indicator data uploaded by aplurality of different terminal devices when a video is played, andperform big data analysis processing, so as to determine whether acurrent video playing policy can take into consideration each qualityindicator of video playing and whether better video playing quality canbe obtained. If the current video playing policy cannot meet therequirement, the server may adjust the video playing policy, forexample, use a new control algorithm or adjust parameters of an originalcontrol algorithm, so as to implement adaptive adjustment of the controlalgorithm. All quality indicators of video playing can be considered toachieve better video playing effect.

Further, the video playing control method may further include:

The server receives information about the target control algorithmuploaded by the terminal device.

The server analyzes the quality indicator data based on the informationabout the target control algorithm, to generate a video playing qualityindicator of the target control algorithm.

The server performs big data analysis based on the received qualityindicator data of each terminal device and the information about theused control algorithm, and may generate the video playing qualityindicator of each control algorithm, so that related personnel canintuitively view video playing effects of each different controlalgorithm.

According to a second aspect, an embodiment of this application providesa terminal device, including a memory, a processor, and a computerprogram that is stored in the memory and can run on the processor. Whenexecuting the computer program, the processor implements the videoplaying control method provided in the first aspect of the embodimentsof this application.

According to a third aspect, an embodiment of this application providesa server, including a memory, a processor, and a computer program thatis stored in the memory and can run on the processor. When executing thecomputer program, the processor implements the video playing controlmethod provided in the first aspect of the embodiments of thisapplication.

According to a fourth aspect, an embodiment of this application providesa computer-readable storage medium, where the computer-readable storagemedium stores a computer program, and when the computer program isexecuted by a processor, the video playing control method provided inthe first aspect of the embodiments of this application is implemented.

According to a fifth aspect, an embodiment of this application providesa computer program product. When the computer program product runs on aterminal device, the terminal device is enabled to perform the videoplaying control method according to any one of the first aspect.

Compared with the conventional technology, a beneficial effect of thisembodiment of this application is that a server may receive qualityindicator data uploaded by a plurality of different terminal deviceswhen a video is played, and perform big data analysis processing, so asto determine whether a current video playing policy can take intoconsideration each quality indicator of video playing. If necessary, theserver may adjust the video playing policy, for example, use a newcontrol algorithm or adjust parameters of an original control algorithm,so as to implement adaptive adjustment of the control algorithm, andtake into consideration each quality index of the video playing, therebyachieving a better video playing effect. This has better usability andpracticability.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of a structure of hardware of a mobilephone to which a video playing control method is applicable according toan embodiment of this application;

FIG. 2 is a flowchart of a video playing control method according to anembodiment of this application;

FIG. 3 is a flowchart of another video playing control method accordingto an embodiment of this application:

FIG. 4 is a flowchart of another video playing control method accordingto an embodiment of this application:

FIG. 5 is a flowchart of a specific implementation of step 405 in FIG. 4;

FIG. 6 is a flowchart of another video playing control method accordingto an embodiment of this application;

FIG. 7 is a flowchart of another video playing control method accordingto an embodiment of this application;

FIG. 8 is a schematic flowchart of a video playing control method in anactual application scenario according to an embodiment of thisapplication;

FIG. 9 is a block diagram of a structure of a video playing controlsystem according to an embodiment of this application:

FIG. 10 is a schematic diagram of a structure of a video playing controlsystem in an actual application scenario according to an embodiment ofthis application;

FIG. 11A and FIG. 11B are a schematic diagram of a service processingprocess of a video playing control system according to an embodiment ofthis application; and

FIG. 12 is a schematic diagram of a terminal device according to anembodiment of this application.

DESCRIPTION OF EMBODIMENTS

In the following description, to illustrate rather than limit, specificdetails such as a particular system structure and a technology areprovided to make a thorough understanding of the embodiments of thisapplication. However, a person skilled in the art should know that thisapplication may also be implemented in other embodiments without thesespecific details. In other cases, detailed descriptions of well-knownsystems, systems, circuits, and methods are omitted, so that thisapplication is described without being obscured by unnecessary details.

Terms used in the following embodiments are merely intended to describeparticular embodiments, but are not intended to limit this application.Terms “one”, “a” and “this” of singular forms used in this specificationand the appended claims of this application are also intended to includeexpressions such as “one or more”, unless otherwise specified in thecontext clearly. It should be further understood that, in embodiments ofthis application, “one or more” refers to one, two, or more, and theterm “and/or” describes an association between associated objects, andindicates that three relationships may exist. For example, A and/or Bmay indicate the following cases: Only A exists, both A and B exist, andonly B exists, where A and B may be singular or plural. The character“/” usually indicates an “or” relationship between the associatedobjects.

The video playing control method provided in the embodiments of thisapplication may be applied to a terminal device and a server, such as amobile phone, a tablet computer, a wearable device, a vehicle-mounteddevice, an augmented reality (augmented reality, AR)/virtual reality(virtual reality, VR) device, a notebook computer, an ultra-mobilepersonal computer (ultra-mobile personal computer, UMPC), a netbook, ora personal digital assistant (personal digital assistant, PDA). Specifictypes of the terminal device and the server are not limited in thisembodiment of this application.

For example, the terminal device may be a station (STAION, ST) in aWLAN, and may be a cellular phone, a cordless phone, a sessioninitiation protocol (Session Initiation Protocol, SIP) phone, a wirelesslocal loop (Wireless Local Loop, WLL) station, a personal digitalassistant (Personal Digital Assistant, PDA) device, a handheld devicewith a wireless communication function, a computing device or otherprocessing device connected to a wireless modem, a vehicle-mounteddevice, an internet of vehicle terminal, a computer, a laptop computer,a handheld communications device, a handheld computing device, asatellite wireless device, a wireless modem card, a television set-topbox (set-top box, STB), a customer premise equipment (customer premiseequipment, CPE), or another device for communicating over a wirelesssystem, and a next-generation communications system, for example, amobile terminal in a 5G network, or a mobile terminal in a futureevolved public land mobile network (Public Land Mobile Network, PLMN)network.

By way of example and not limitation, when the terminal device is awearable device, the wearable device may alternatively be a generic termfor wearable devices such as glasses, gloves, watches, clothes, andshoes that are developed based on intelligent design of daily wearing byusing wearable technologies. The wearable device is directly worn, or isa portable device integrated into clothes or an accessory of the user.The wearable device is more than a hardware device. The wearable deviceimplements powerful functions through software support, data exchange,and cloud interaction. In a broad sense, the wearable intelligent deviceincludes a device that provides a complete function, has a large size,and can implement all or some functions without relying on a smartphone,for example, a smartwatch or smart glasses; and includes a device thatfocuses only on a specific type of application and needs to be used incombination with another device such as a smartphone, for example,various smart bands and smart jewelry used for vital sign monitoring.

For example, the terminal device is a mobile phone. FIG. 1 is a blockdiagram of a partial structure of the mobile phone according to anembodiment of this application. Refer to FIG. 1 . The mobile phoneincludes components such as a radio frequency (Radio Frequency. RF)circuit 110, a memory 120, an input unit 130, a display unit 140, asensor 150, an audio circuit 160, a wireless fidelity (wirelessfidelity, WiFi) module 170, a processor 180, and a power source 190. Aperson skilled in the art may understand that a structure of the mobilephone shown in FIG. 1 does not constitute a limitation on the mobilephone. The mobile phone may include more or fewer components than thoseshown in the figure, or may include a combination of some components, ormay include different component arrangements.

The following describes each component of the mobile phone in detailwith reference to FIG. 1 .

The RF circuit 110 may be configured to receive and send a signal in aninformation receiving or sending process or a call process.Particularly, after receiving downlink information from a base station,the RF circuit 110 sends the downlink information to the processor 180for processing, and in addition, sends designed uplink data to the basestation. Usually, an RF circuit includes but is not limited to anantenna, at least one amplifier, a transceiver, a coupler, a low noiseamplifier (Low Noise Amplifier, LNA), a duplexer, and the like. Inaddition, the RF circuit 110 may further communicate with a network andanother device through wireless communication. The foregoing wirelesscommunications may use any communications standard or protocol, whichincludes but is not limited to a global system for mobile communications(Global System of Mobile communication, GSM), a general packet radioservice (General Packet Radio Service, GPRS), code division multipleaccess (Code Division Multiple Access, CDMA), wideband code divisionmultiple access (Wideband Code Division Multiple Access, WCDMA), longterm evolution (Long Term Evolution, LTE), an email, a short messageservice (Short Messaging Service, SMS), and the like.

The memory 120 may be configured to store a software program and amodule. By running the software program and the module that are storedin the memory 120, the processor 180 performs various functionapplications and data processing of the mobile phone. The memory 120 maymainly include a program storage area and a data storage area. Theprogram storage area may store an operating system, an applicationprogram required by at least one function (for example, a sound playingfunction or an image playing function), and the like. The data storagearea may store data (for example, audio data or an address book) and thelike created based on use of the mobile phone. In addition, the memory120 may include a high-speed random access memory, or may include anonvolatile memory, such as at least one magnetic disk storage device, aflash memory device, or another volatile solid-state storage device.

The input unit 130 may be configured to: receive entered digital orcharacter information, and generate key signal input related to a usersetting and function control of the mobile phone 100. Specifically, theinput unit 130 may include a touch panel 131 and another input device132. The touch panel 131, also referred to as a touchscreen, may collecta touch operation of a user on or near the touch panel 131 (such as anoperation of the user on the touch panel 131 or near the touch panel 131by using any suitable object or attachment, such as a finger or a touchpen), and drive a corresponding connection system according to a presetprogram. Optionally, the touch panel 131 may include two parts: a touchdetection system and a touch controller. The touch detection systemdetects a touch position of the user, detects a signal generated by thetouch operation, and transfers the signal to the touch controller. Thetouch controller receives touch information from the touch detectionsystem, converts the touch information into touch point coordinates, andthen sends the touch point coordinates to the processor 180. Moreover,the touch controller can receive and execute a command sent from theprocessor 180. In addition, the touch panel 131 may be implemented byusing a plurality of types, such as a resistive type, a capacitive type,an infrared ray type, and a surface acoustic wave type. In addition tothe touch panel 131, the input unit 130 may include the another inputdevice 132. Specifically, the another input device 132 may include butbe not limited to one or more of a physical keyboard, a functional key(such as a volume control key or an on/off key), a trackball, a mouse,or a joystick.

The display unit 140 may be configured to display information entered bythe user or information provided for the user, and various menus of themobile phone. The display unit 140 may include a display panel 141.Optionally, the display panel 141 may be configured by using a liquidcrystal display (Liquid Crystal Display, LCD), an organic light-emittingdiode (Organic Light-Emitting Diode, OLED), or the like. Further, thetouch panel 131 may cover the display panel 141. When detecting thetouch operation on or near the touch panel 131, the touch panel 131transfers the touch operation to the processor 180 to determine a typeof a touch event, and then the processor 180 provides correspondingvisual output on the display panel 141 based on the type of the touchevent. In FIG. 1 , the touch panel 131 and the display panel 141 areused as two independent components to implement input and inputfunctions of the mobile phone. However, in some embodiments, the touchpanel 131 and the display panel 141 may be integrated to implement theinput and output functions of the mobile phone.

The mobile phone 100 may further include at least one type of sensor150, for example, a light sensor, a motion sensor, and another sensor.Specifically, the light sensor may include an ambient light sensor and aproximity sensor. The ambient light sensor may adjust luminance of thedisplay panel 141 based on brightness of ambient light, and theproximity sensor may turn off the display panel 141 and/or backlightwhen the mobile phone approaches an ear of the user. As a type ofmovement sensor, an accelerometer sensor may detect a value ofacceleration in each direction (usually on three axes), may detect avalue and a direction of gravity in a stationary state, and may be usedin an application for identifying a mobile phone posture (such as screenswitching between a landscape mode and a portrait mode, a related game,or magnetometer posture calibration), a function related to vibrationidentification (such as a pedometer or a knock), or the like. Othersensors such as a gyroscope, a barometer, a hygrometer, a thermometer,or an infrared sensor may be further configured in the mobile phone.Details are not described herein.

The audio frequency circuit 160, a loudspeaker 161, and a microphone 162may provide an audio interface between the user and the mobile phone.The audio circuit 160 may transmit, to the speaker 161, an electricalsignal that is converted from received audio data, and the speaker 161converts the electrical signal into a sound signal for output. Inaddition, the microphone 162 converts a collected sound signal into anelectrical signal, and the audio circuit 160 receives the electricalsignal, converts the electrical signal into audio data, and outputs theaudio data to the processor 180 for processing, to send the audio datato, for example, another mobile phone by using the RF circuit 110, oroutput the audio data to the memory 120 for further processing.

Wi-Fi belongs to a short-distance wireless transmission technology. Themobile phone may help, by using the Wi-Fi module 170, the user receiveand send an email, browse a web page, access streaming media, and thelike. The Wi-Fi module 170 provides wireless broadband internet accessfor the user. Although FIG. 1 shows the Wi-Fi module 170, it can beunderstood that the Wi-Fi module 170 is not a necessary part of themobile phone 100 and may certainly be omitted as required provided thatthe essence of the present invention is not changed.

The processor 180 is a control center of the mobile phone, and usesvarious interfaces and lines to connect all parts of the entire mobilephone. By running or executing the software program and/or the modulethat are/is stored in the memory 120 and invoking data stored in thememory 120, the processor 180 executes various functions and dataprocessing of the mobile phone, so as to perform overall monitoring onthe mobile phone. Optionally, the processor 180 may include one or moreprocessing units. Preferably, the processor 180 may integrate anapplication processor and a modem processor. The application processormainly processes an operating system, a user interface, an application,and the like. The modem processor mainly processes wirelesscommunication. It may be understood that the foregoing modem processormay be not integrated into the processor 180.

The mobile phone 100 further includes a power supply 190 (for example, abattery) supplying power to the components. Preferably, the power supplymay be logically connected to the processor 180 by using a powermanagement system, to implement functions such as charging anddischarging management and power consumption management by using thepower management system.

Although not shown, the mobile phone 100 may further include a camera.Optionally, a position of the camera on the mobile phone 100 may befront-facing or rear-facing. This is not limited in this embodiment ofthis application.

Optionally, the mobile phone 100 may include a single camera,dual-camera, triple-lens camera, or the like. This is not limited inthis embodiment of this application.

For example, the mobile phone 100 may include a triple-lens camera,where one is a primary camera, one is a wide-angle camera, and one is along-focus camera.

Optionally, when the mobile phone 100 includes a plurality of cameras,the plurality of cameras may be all front-facing, or all rear-facing, orsome front-facing and some rear-facing. This is not limited in thisembodiment of this application.

In addition, although not shown in the figure, the terminal 100 mayfurther include a Bluetooth module and the like. Details are notdescribed herein.

Currently, to improve an online video playing effect, a preset adaptivecontrol algorithm is usually used to play a video. For example, if anetwork bandwidth fluctuates greatly during video playing, anappropriate bit rate of a resolution is selected based on the networkbandwidth change to start video playing, or a bit rate is adjustedduring video playing, to ensure fast video playing, smooth videoplaying, and zero freeze. Specifically, the control algorithms include auser bandwidth estimation algorithm, a playing start bit rate selectionalgorithm, an algorithm for selecting a download bit rate based on achange of a user network in a playing process, and the like. Forexample, HLS and DASH protocols are used. In a process of starting orplaying a video, a subsequent download rate of a user is estimated basedon download rates of a plurality of actual video segments before theuser currently wants to download a video segment by using a setalgorithm, a factor, a coefficient, and the like, and a bit rate of anext to-be-downloaded video segment is selected. The target is that zerofreeze occurs during the video playing.

However, each parameter of an existing control algorithm is staticempirical data obtained based on a network model test in a laboratory.For a current network of tens of millions of users, a static algorithmand parameters are used, and therefore, each quality index of videoplaying cannot be considered. For example, if a playing start delay isshort and zero freeze is required, a video bitstream with a lowresolution and bit rate needs to be selected, but video playingdefinition is poor. If a video bitstream with a high resolution and bitrate is selected, the video playing definition is good, but the playingstart delay is long and a freeze rate is high.

In actual situations, to reduce the playing start delay and the freezerate, a resolution and bit rate that are lower than a matched userbandwidth are usually selected, so as to obtain good playing smoothnessand reduce the playing start delay. In this way, after the video playingstarts, the video cannot be switched to a high resolution or bit ratewithin a short period of time even if the network of the user is good.As a result, definition of a large-screen TV cannot match Blu-ray videoquality, and the user cannot watch video content with better videoquality.

FIG. 2 is a flowchart of a video playing control method according tothis application. The method includes the following steps.

201: A terminal device obtains a video playing policy, where the videoplaying policy is used to determine information about a controlalgorithm used for current video playing.

In this embodiment of this application, the video playing control methodis performed by any type of terminal device. After starting a videoplaying software, the terminal device may obtain a video playing policy,where the video playing policy is used to determine information about acontrol algorithm used for current video playing. Specifically, thevideo playing policy may be provided by a server. An administrator mayset and store a plurality of different video playing policies on theserver. After receiving a video playing request sent by the terminaldevice, the server delivers the video playing policy to the terminaldevice.

202: The terminal device determines, according to the video playingpolicy, a target control algorithm used for current video playing.

After obtaining the video playing policy, the terminal devicedetermines, according to the video playing policy, a target controlalgorithm used for current video playing, where the target controlalgorithm is preferably selected as a bit rate adaptive controlalgorithm. For example, preset control algorithms include an algorithm Aand an algorithm B. The algorithm A focuses on smoothness of videoplaying, and the algorithm B focuses on definition of video playing. Ifthe obtained video playing policy tends to ensure smoothness of videoplaying, the algorithm A may be selected as the control algorithm usedfor current video playing, that is, the target control algorithm.

203. The terminal device downloads and plays a video by using the targetcontrol algorithm.

After determining the target control algorithm used for current videoplaying, the terminal device downloads and plays the video by using thetarget control algorithm. In other words, a control manner and a playingparameter of a player are set according to the target control algorithm.In addition, sometimes, before the video is played, the terminal devicefurther needs to send an authentication request for playing to a videooperation system, and only after the operation system returns a resultindicating that authentication succeeds, the terminal device starts todownload and play the video. Specifically, the terminal device maydownload to-be-played video data from a specified CDN server.

204: The terminal device collects video playing quality indicator datain a process of downloading and playing a video.

In the process of downloading and playing the video, the terminal devicefurther collects the video playing quality indicator data in real time,for example, indicator data related to the video playing quality, suchas a playing start delay, a zero freeze rate, playing definition, andplaying success/failure. It should be understood that a time forcollecting the quality indicator data may include three phases: a videoplaying start, a video playing process, and a video playing end.

Further, in the process of downloading and playing the video, the methodmay further include:

(1). The terminal device detects a current network download rate.

(2). If the network download rate exceeds a first threshold, theterminal device obtains a video segment that has been buffered in alocal buffer.

(3). If a resolution of the buffered video segment is less than a secondthreshold and/or a bit rate is less than a third threshold, the terminaldevice downloads a video segment whose resolution is greater than orequal to the second threshold and whose bit rate is greater than orequal to the third threshold in a same time period; and replaces thebuffered video segment.

A video segment is also called a video slice. During video encoding, apiece of content is divided into a plurality of slices of 2 s to 10 s.During video playing, the video slice is downloaded to a local bufferfor playing in a small slice downloading manner. The playing in slicemode is cost-effective and applicable to a large-scale OTT VOD or liveTV scenario.

In the process of downloading and playing the video, if a currentnetwork download rate is relatively high, a video segment that has beencached in a local buffer may be detected. If a resolution/bit rate ofthe cached video segment is relatively low, content with a higherresolution or bit rate in the same time period may be selected to bedownloaded, and content in the local buffer is replaced, so as toresolve a problem that a user has poor viewing definition due todownloading content with a low resolution or a bit rate due to a networkspeed or a buffer watermark.

For example, a user network of a live network often fluctuates. Whennetwork quality is poor, a low-resolution 480P bitstream is downloadedto the buffer through a bit rate adaptation algorithm. In thisembodiment of this application, the previously downloaded low-resolution480P bitstream is automatically replaced with a high-resolution 1080Pbitstream based on the user network and information about the currentbuffer, so as to improve viewing video quality of the user.

205: The terminal device uploads the quality indicator data to theserver, to indicate the server to adjust the video playing policy basedon the quality indicator data.

After collecting the video playing quality indicator data, the terminaldevice uploads the data to a server, to indicate the server to adjustthe video playing policy based on the quality indicator data.Specifically, the server may be a server that delivers the video playingpolicy to each terminal device, and is configured to control videoplaying. After receiving the quality indicator data, the server mayanalyze and process the data, so as to determine whether a current videoplaying policy can take into consideration each quality indicator ofvideo playing and whether better video playing quality can be obtained.When necessary, the video playing policy may be adjusted, for example, anew control algorithm is used or parameters of an original controlalgorithm is adjusted, so as to achieve a better video playing effect.

In this embodiment of this application, when playing the video online,the terminal device obtains the video playing policy, determines,according to the video playing policy, the control algorithm set for aplayer, and controls downloading and playing of the video by using thecontrol algorithm. In addition, during the process of downloading andplaying the video, the player collects the video playing qualityindicator data in real time and reports the data to the server. Theserver may receive the quality indicator data uploaded by a plurality ofdifferent terminal devices when a video is played, and perform big dataanalysis processing, so as to determine whether a current video playingpolicy can take into consideration each quality indicator of videoplaying and whether better video playing quality can be obtained. If thecurrent video playing policy cannot meet the requirement, the server mayadjust the video playing policy, for example, use a new controlalgorithm or adjust parameters of an original control algorithm, so asto implement adaptive adjustment of the control algorithm. All qualityindicators of video playing can be considered to achieve better videoplaying effect.

FIG. 3 is a flowchart of another video playing control method accordingto this application. The method includes the following steps.

301: A terminal device obtains a video playing policy, where the videoplaying policy is used to determine information about a controlalgorithm used for current video playing.

In this embodiment of this application, the video playing control methodis performed by any type of terminal device. After starting a videoplaying software, the terminal device may obtain a video playing policy,where the video playing policy is used to determine information about acontrol algorithm used for current video playing. For a specificdescription of step 301, refer to step 201.

302: The terminal device obtains a device type of the terminal device.

After obtaining the video playing policy, the terminal device detectsthe device type of the terminal device, for example, a small-screenmobile phone, a large-screen mobile phone, a pad, a large-screentelevision, or a notebook computer.

303: The terminal device selects, according to the video playing policy,a control algorithm corresponding to the device type from a plurality ofpreset control algorithms as a target control algorithm.

For different types of terminal devices, different control algorithmsmay be used to control video playing, so as to achieve a better videoplaying effect. For example, mobile phones have low requirements onvideo definition and a bit rate, and high requirements on a playingstart delay and playing smoothness. A large-screen TV has a highrequirement on the viewing definition and a low requirement on theplaying start delay. Therefore, for the mobile phone device, a controlalgorithm that can implement the low playing start delay and highplaying smoothness may be selected. For large-screen TV devices, acontrol algorithm that can realize high-definition playing can beselected. Through this setting, the video playing control method can beapplied to a plurality of different use scenarios, thereby extendinggenerality of the method.

304: The terminal device downloads and plays a video by using the targetcontrol algorithm.

305: The terminal device collects video playing quality indicator datain a process of downloading and playing a video.

306: The terminal device uploads the quality indicator data to a server,to indicate the server to adjust the video playing policy based on thequality indicator data.

For specific descriptions of steps 304 to 306, refer to steps 203 to205.

For ease of describing the control method in the embodiments of thisapplication, the following uses an actual application example.

A video service carrier has provided 500,000 hours of video content onthe live network. Initially, the carrier provides services for mobilephones, providing bitstreams for mobile phones and large-screen TVterminals to which 480P, 720P, or 1080P bit rates apply. An original bitrate adaptation algorithm mainly applies to mobile phones and usesstatic algorithms and fixed parameters. The mobile phones have a smallscreen size, and the bit rate adaptation algorithm is conservative.Therefore, after the video playing starts, users need to watch contentwith a low resolution or bit rate for a long time. Even when the user'snetwork is in good condition, it still takes more than 80 seconds toswitch to 1080P Blu-ray video quality.

Because the screen of the mobile phone user is small, even a lowresolution or bit rate is acceptable when the user watches a video.However, if the foregoing bit rate adaptation algorithm is still usedwhen video playing of a large-screen TV is subsequently operated, aresolution of the Blu-ray video quality cannot be switched to for a longtime after the video playing starts. This causes a great impact on userviewing experience, and cannot be accepted by the user. To solve thisproblem, in this embodiment of this application, a video playing policyis set, and a control algorithm dedicated to the large-screen TV isselected. For example, it may be set specifically for the large-screenTV that an average value algorithm may be used or parameters may bemodified for a predicted bandwidth, so as to flexibly adjust thealgorithm. In this way, the large-screen TV can quickly switch toBlu-ray video quality after the video playing starts. In addition, thevideo playing quality indicator data can be comprehensively analyzed,including a playing start delay, a zero freeze rate, and high-qualityplaying duration. A parameter and factor of the control algorithm can beflexibly adjusted based on a data analysis result, to achieve optimalviewing experience for large-screen TV users.

In this embodiment of this application, when playing the video online,the terminal device obtains the video playing policy, determines,according to the video playing policy, the control algorithm set for aplayer, and controls downloading and playing of the video by using thecontrol algorithm. In addition, during the process of downloading andplaying the video, the player collects the video playing qualityindicator data in real time and reports the data to the server. Theserver may receive the quality indicator data uploaded by a plurality ofdifferent terminal devices when a video is played, and perform big dataanalysis processing, so as to determine whether a current video playingpolicy can take into consideration each quality indicator of videoplaying and whether better video playing quality can be obtained. Inaddition, for different types of terminal devices, different controlalgorithms may be separately used to control video playing, so that thevideo playing control method can be applicable to a plurality ofdifferent use scenarios, thereby extending generality of the method.

FIG. 4 is a flowchart of another video playing control method accordingto this application. The method includes the following steps.

401: A terminal device obtains a video playing policy, where the videoplaying policy is used to determine information about a controlalgorithm used for current video playing.

In this embodiment of this application, the video playing control methodis performed by any type of terminal device. After starting a videoplaying software, the terminal device may obtain a video playing policy,where the video playing policy is used to determine information about acontrol algorithm used for current video playing. For a specificdescription of this step, refer to step 201.

402: The terminal device receives a first control algorithm delivered bya server.

In this embodiment of this application, the terminal device receives notonly the video playing policy from the server, but also includes thefirst control algorithm. The algorithm itself and the factor or theparameter of the first control algorithm can be dynamically adjusted. Anadministrator initializes the first control algorithm and the algorithmparameter on the server side, and when adjusting the video playingpolicy in a subsequent step, the administrator may adjust the firstcontrol algorithm and the algorithm parameter accordingly, so as toachieve a better video playing effect.

403: The terminal device determines a version number of video playingsoftware used for video playing.

404: The terminal device searches locally or from the server for apreset second control algorithm associated with the version number.

Usually, each video playing software has a default control algorithm,and the default control algorithm is usually used when a video isplayed. In addition, default control algorithms used by differentversions of software are usually different. Therefore, to obtain thedefault control algorithm (that is, the second control algorithm), theterminal device first needs to determine a version number of the videoplaying software used for video playing, and then searches for a controlalgorithm associated with the version number. The default controlalgorithm may be searched locally from the terminal device, may besearched from the server, or may be searched from any device interactingwith the terminal device.

405: The terminal device selects a target control algorithm from thefirst control algorithm and the second control algorithm according tothe video playing policy.

After obtaining the first control algorithm and the second controlalgorithm, the terminal device selects one of the first controlalgorithm and the second control algorithm according to the videoplaying policy as the target control algorithm to be used.

Specifically, as shown in FIG. 5 , step 405 may include the followingsteps:

4051: The terminal device obtains a historical record of each controlalgorithm used by the video playing software to play a video.

4052: The terminal device determines an invocation ratio of the firstcontrol algorithm according to the video playing policy.

4053: The terminal device selects a control algorithm from the firstcontrol algorithm and the second control algorithm based on thehistorical record and the invocation ratio as the target controlalgorithm.

For example, it is determined, according to the video playing policy,that the invocation ratio of the first control algorithm is 3:7. In 10times of video playing initiated by the video playing software, thefirst control algorithm is used for three times, and the second controlalgorithm is used for seven times. Then, with reference to a record ofeach control algorithm used by the video playing software forhistorically playing a video, for example, control algorithms used forthe previous nine times, it may be determined that the first controlalgorithm or the second control algorithm is used for playing the videothis time.

In addition, the first control algorithm or the second control algorithmmay also be directly determined to be used according to the videoplaying policy. For example, if a policy 1 is received, the firstcontrol algorithm is determined to be used for current video playing. Ifa policy 2 is received, the second control algorithm is determined to beused for current video playing.

406: The terminal device downloads and plays a video by using the targetcontrol algorithm.

407: The terminal device collects video playing quality indicator datain a process of downloading and playing a video.

For specific descriptions of steps 406 and 407, refer to steps 203 and204.

Specifically, after the terminal device collects the video playingquality indicator data, the method may further include:

If the target control algorithm is the first control algorithm, theterminal device uploads the quality indicator data to the server, toindicate the server to adjust the first control algorithm and parametersof the first control algorithm based on the quality indicator data.

A factor or a parameter of the first control algorithm may be flexiblyadjusted. Therefore, if the first control algorithm is used for currentvideo playing, the server may adjust the first control algorithm and theparameter of the first control algorithm based on the quality indicatordata uploaded by the terminal device. This improves the quality andeffect of video playing.

Specifically, after the terminal device collects the video playingquality indicator data, the method may further include:

If the target control algorithm is the first control algorithm and thequality indicator data meets a preset condition, the terminal devicecancels an association relationship between the second control algorithmand the version number, and associates the first control algorithm withthe version number.

After receiving the upload quality indicator data that is used by eachterminal device to play the video by using the first control algorithm,the server may analyze the quality indicator data, and further determinea video playing effect of the first control algorithm. If the qualityindicator data meets a preset condition, it indicates that the videoplaying effect is relatively good and is better than that of the defaultsecond control algorithm. In this case, the terminal device may cancelthe association relationship between the second control algorithm andthe version number, and the first control algorithm is associated withthe version number. The default control algorithm for subsequent videoplaying is updated to the first control algorithm. In addition, theadministrator may also associate the first control algorithm with a nextversion number of the video playing software.

408: The terminal device uploads the quality indicator data to theserver, to indicate the server to adjust the video playing policy basedon the quality indicator data.

Specifically, that the terminal device uploads the quality indicatordata to the server, to indicate the server to adjust the video playingpolicy based on the quality indicator data may include:

The terminal device uploads the quality indicator data to the server, toindicate the server to adjust the invocation ratio based on the qualityindicator data.

For example, the invocation ratio of the first control algorithm may berelatively low initially. In other words, a default relatively stablesecond control algorithm is more used. After receiving the uploadquality indicator data that is used by each terminal device to play thevideo by using the first control algorithm, the server may analyze thequality indicator data, and further determine a video playing effect ofthe first control algorithm. If it is found that the video playingeffect of the first control algorithm is better, the invocation ratio ofthe first control algorithm may be correspondingly increased, so as toimprove the overall video playing effect.

Specifically, after that the terminal device uploads the qualityindicator data to the server, the method may further include:

The terminal device uploads information about the selected targetcontrol algorithm to the server, so as to indicate the server to analyzethe quality indicator data based on the information about the selectedtarget control algorithm, and generates a video playing qualityindicator of the first control algorithm and a video playing qualityindicator of the second control algorithm.

For example, terminal devices A, B, and C play a video by using thefirst control algorithm, and upload respective video playing qualityindicator data to the server. Terminal devices R, S, T . . . play thevideo by using the second control algorithm, and upload respective videoplaying quality indicator data to the server. The server performs bigdata analysis based on the received quality indicator data of eachterminal device and the information about the used control algorithm,and may generate the video playing quality indicator of the firstcontrol algorithm and the video playing quality indicator of the secondcontrol algorithm. The video playing effect of different controlalgorithms can be viewed intuitively by relevant personnel.Specifically, the video playing quality indicators may include a playingstart delay, a zero freeze rate, a playing success rate, playingduration of resolutions (such as 1080P Blu-ray, 720P HD, and 480P SD),and resolution/bit rate switching information.

In this embodiment of this application, when playing the video online,the terminal device obtains the video playing policy, determines,according to the video playing policy, the control algorithm set for aplayer, and controls downloading and playing of the video by using thecontrol algorithm. In addition, during the process of downloading andplaying the video, the player collects the video playing qualityindicator data in real time and reports the data to the server. Theserver may receive the quality indicator data uploaded by a plurality ofdifferent terminal devices when a video is played, and perform big dataanalysis processing, so as to determine whether a current video playingpolicy can take into consideration each quality indicator of videoplaying and whether better video playing quality can be obtained. If thecurrent video playing policy cannot meet the requirement, the server mayadjust the video playing policy, for example, use a new controlalgorithm or adjust parameters of an original control algorithm, so asto implement adaptive adjustment of the control algorithm. All qualityindicators of video playing can be considered to achieve better videoplaying effect.

FIG. 6 is a flowchart of another video playing control method accordingto this application. The method includes the following steps.

601: After receiving a video playing request sent by a terminal device,a server sends a video playing policy to the terminal device, so as toindicate the terminal device to determine, according to the videoplaying policy, a target control algorithm used for current videoplaying, and download and play a video by using the target controlalgorithm, where the video playing policy is used to determineinformation about a control algorithm used for current video playing.

602: The server receives video playing quality index data uploaded bythe terminal device, where the quality index data is obtained by theterminal device through collection in a process of downloading andplaying a video.

603: The server adjusts the video playing policy according to thequality indicator data.

Further, the video playing control method may further include:

The server receives information about the target control algorithmuploaded by the terminal device.

The server analyzes the quality indicator data based on the informationabout the target control algorithm, to generate a video playing qualityindicator of the target control algorithm.

In this embodiment of this application, the video playing control methodmay be performed by a server configured to control video playing. Anoperation administrator sets a video playing policy and differentadaptive control algorithms on the server. After starting video playingsoftware, a terminal device sends a video playing request to the server,and the server delivers the video playing policy to the terminal devicebased on the video playing request. In addition, the server may furthersimultaneously deliver one or more control algorithms to the terminaldevice, and then determine, according to the video playing policy, acontrol algorithm used for current video playing.

Then, a player of the terminal device uploads the video playing qualityindicator data to the server. The server analyzes the received qualityindicator data, and determines whether the video playing policy needs tobe adjusted, for example, adjusting a used control algorithm oradjusting each parameter of the control algorithm. It should beunderstood that the server may be interconnected with a plurality ofdifferent terminal devices, that is, receive quality indicator data anda used control algorithm that are uploaded by the plurality of differentterminal devices when a video is played, and perform big data analysison the data. It may be determined whether the current video playingpolicy can take into consideration each quality indicator ofthe videoplaying, and whether relatively good video playing quality can beobtained. In addition, the server may further generate a video playingquality index of each control algorithm, so that relevant personnel canintuitively view video playing effects of each control algorithm.

An embodiment of this application further provides a server, including amemory, a processor, and a computer program that is stored in the memoryand that can run on the processor. When executing the computer program,the processor implements the video playing control method shown in FIG.6 of this application.

FIG. 7 is a flowchart of another video playing control method accordingto this application. The method includes the following steps.

701: After receiving a video playing request sent by a terminal device,a server sends a video playing policy to the terminal device, where thevideo playing policy is used to determine information about a controlalgorithm used for current video playing.

702: After receiving the video playing policy, the terminal devicedetermines, according to the video playing policy, a target controlalgorithm used for current video playing.

703: The terminal device downloads and plays a video by using the targetcontrol algorithm.

704: The terminal device collects video playing quality indicator datain a process of downloading and playing a video.

705: The terminal device uploads the quality indicator data to theserver.

706: The server adjusts the video playing policy according to thequality indicator data.

Embodiments of this application provide a video playing control methodin which the server interacts with the terminal device. After starting avideo playing software, the terminal device sends a video playingrequest to the server, and the server delivers a video playing policy tothe terminal device based on the video playing request. In addition, theserver may further simultaneously deliver one or more control algorithmsto the terminal device, and then the terminal device determines,according to the video playing policy, a control algorithm used forcurrent video playing. Then, the terminal device controls downloadingand playing of the video by using the determined control algorithm. Inthe process of downloading and playing the video, the player collectsvideo playing quality index data in real time, and reports the data tothe server. The server may receive the quality indicator data uploadedby a plurality of different terminal devices when a video is played, andperform big data analysis processing, so as to determine whether acurrent video playing policy can take into consideration each qualityindicator of video playing and whether better video playing quality canbe obtained. If the current video playing policy cannot meet therequirement, the server may adjust the video playing policy, forexample, use a new control algorithm or adjust parameters of an originalcontrol algorithm, so as to implement adaptive adjustment of the controlalgorithm. All quality indicators of video playing can be considered toachieve better video playing effect.

It should be understood that sequence numbers of the steps do not meanan execution sequence in the foregoing embodiments. The executionsequence of the processes should be determined based on functions andinternal logic of the processes, and should not constitute anylimitation on the implementation processes of the embodiments of thisapplication.

For ease of understanding, the video playing control method proposed inthis application is described below by using an actual applicationscenario.

FIG. 8 is a schematic flowchart of a video playing control method in anactual application scenario according to this application. The methodincludes the following steps.

801: An administrator sets a video playing policy and a controlalgorithm in a playing policy control system of a server.

802: A video app of a terminal device obtains the video playing policyfrom the server when being started.

803: A user taps a video in the video app to play, and a player of thevideo app configures, according to the video playing policy, a controlalgorithm and parameters that are used for current video playing.

804: In a process of starting, playing, and ending playing of the video,the video app collects and reports video playing quality index data tothe server, and related information about a control algorithm used forthe current video playing is provided.

805: A quality analysis and monitoring system of the server analyzes thereported data to obtain key data such as a video playing quality indexof the used control algorithm.

806: The quality analysis and monitoring system synchronizes the keydata to the playing policy control system.

807: The playing policy control system performs comparative analysis onkey data of large-scale users, and adjusts the video playing policy andparameters of the control algorithm based on a result of the comparativeanalysis.

The adjusted video playing policy is updated to a policy library forsaving.

For step 801, the server may include the playing policy control systemand the quality analysis and monitoring system. The playing policycontrol system is configured to manage each video playing policy, andthe quality analysis and monitoring system is configured to analyze thereported quality indicator data. An administrator of the video playingoperation may preset each video playing policy and a control algorithmin the playing policy control system Specifically, the set controlalgorithm may include but is not limited to the following algorithms:

(1) Network Bandwidth Prediction Algorithm

1. Bandwidth Calculated by a Harmonic Average Value

If a bandwidth window list stores the latest 30 bandwidth values (abandwidth 1 to a bandwidth 30), a predicted bandwidth is 30/(1/bandwidth1+1/bandwidth 2+ . . . +1/bandwidth 30).

2. Bandwidth Calculated by an Average Value

If a bandwidth window list stores the latest 30 bandwidth values (abandwidth 1 to a bandwidth 30), a predicted bandwidth is (bandwidth1+bandwidth 2+ . . . +bandwidth 30)/30. Further, the average valuecalculation may further remove a certain download bandwidth thatdefinitely deviates too much, for example, a bandwidth value thatdeviates from the average bandwidth by more than three times (greaterthan or less than three times of the average bandwidth), and calculatethe average value after the bandwidth values are removed.

3. Weight-Based Bandwidth Calculation

Predicted bandwidth=historical weight×historical bandwidth+currentweight×actual bandwidth. For example, the historical weight is 0.3 andthe current weight is 0.7.

(2) Playing Start Predicted Algorithm

That is, how many cached data can be downloaded before video playingstarts, to prevent freeze after playing starts. The amount of bufferedplaying start data to be downloaded depends on an estimated downloadrate. For example, if the download rate is more than 10 times of a bitrate, the playing can be started after data that can be used to play avideo for 800 ms is downloaded. If the download rate is twice the bitrate, the playing can be started only after data that can be used toplay a video for 10 s is downloaded.

(3) Playing Start Bit Rate Selection Algorithm

A playing start bit rate is selected. For example, the maximum bit rateis 480P and a bit rate is lower than the latest historical downloadrate×0.2.

(4) Buffer Bit Rate Switching Algorithm

Each time before downloading a next video segment, the player selects,based on a predicted bandwidth and a bandwidth attenuation coefficient,a video segment with a specific resolution or bit rate to download. Thepredicted download bandwidth of the user is calculated based onreal-time download rates of a plurality of times by using a plurality ofavailable methods. The bandwidth attenuation coefficient is calculatedbased on different watermarks (high, medium, and low) of the videobuffer. For the bit rate of the next video segment, a bit rate that isnot greater than and is closest to a value obtained by the predictedbandwidth multiplied by the bandwidth attenuation coefficient isselected.

1. Low Watermark Bit Rate Switching Algorithm

A value of a buffer low watermark is a buffer size×a low watermarkcoefficient. When the buffer watermark is low and a bit rate of a nextto-be-downloaded video segment is selected, the bandwidth attenuationcoefficient is set to a low value to avoid freeze. For example, if anamount of data currently downloaded in the buffer decreases, a bit rateis not switched up (that is, the bit rate of the downloaded videosegment is increased) or the bit rate is slightly switched up.

2. Medium Watermark Bit Rate Switching Algorithm

The medium watermark in the buffer is between the high and lowwatermarks in the buffer. At the medium watermark in the buffer, theselected bandwidth attenuation coefficient is large. When an amount ofdata to be downloaded in the buffer is between 0.9 and 1.1 times of thebuffer size, the bit rate remains unchanged, that is, the bit rate isnot switched up or down.

3. High Watermark Bit Rate Switching Algorithm

A value of a buffer high watermark is the buffer size multiplied by ahigh watermark coefficient. When the buffer watermark is high, the bitrate can be kept unchanged, or the bit rate can be slightly switcheddown or radically switched up. For example, if a bit rate after the bitrate increases by one level<predicted bandwidth×high watermark bandwidthattenuation coefficient×1.5, the bit rate can increase by one level.

Factors or parameters that can be adjusted by the foregoing controlalgorithms include but are not limited to: a historical bandwidth weightcoefficient, a current bandwidth weight coefficient, and the like of aweighing sub-algorithm of a user predicted bandwidth algorithm, amultiplier parameter of the playing start predicted algorithm, forexample, the predicted bandwidth is 10 times of a bit rate of ato-be-downloaded slice, and the playing can be started after data thatcan be used to play a video for 800 ms is downloaded; applicableterminal types, such as mobile phones, pads, and large-screen TVs,watermark factor (buffer size, start watermark factor, medium watermarkfactor, high watermark factor), bandwidth factor, bandwidth factor, andthe like.

For steps 802 and 803, a video app of the terminal device obtains avideo playing policy from the server when being started, and when theuser taps a video content to initiate playing, the bit rate adaptationalgorithm determines, according to the video playing policy, a controlalgorithm used for current video playing. For example, a default controlalgorithm of the video app is A, and an adjustable control algorithmreceived from the server is B. If the video playing policy is set to apolicy 1, the app determines to use the algorithm A and parameters orthe algorithm B and parameters based on an invocation ratio. If a timesinvocation ratio between A and B is 3:7, in every 10 times of videoplaying, the app uses the algorithm A and parameters for three times ofvideo playing and uses the algorithm B and parameters for seven times ofvideo playing. The app records historical values of the algorithm A andalgorithm B and the parameters for playing. The app determines thealgorithm to be used for the current playing based on the ratio andhistorical values. If the video playing policy is set to a policy 2, theapp uses only algorithm B and parameters to play the video. If the videoplaying policy is set to a policy 3, the app uses the default algorithmA and parameters to play the video. In addition, the parameter value ofthe algorithm B can be set based on a target of large-scale verificationon the live network of the current app version. Each algorithm andfactor has a unique parameter name. A plurality of values can be set fora parameter that ensures uniqueness. The plurality of values can beseparated by specific symbols, for example, “;”.

For step 804, in a process of starting, playing, and ending videoplaying, the video app collects and reports video playing qualityindicator data to the server, for example, data such as a playing startdelay, a zero freeze rate, and playing definition. In addition, relatedinformation about the control algorithm used in the video playing isprovided, for example, whether the algorithm A or algorithm B is used.

For steps 805 to 807, a quality analysis and monitoring system of theserver analyzes the reported data to obtain key data such as a videoplaying quality indicator of the used control algorithm, for example, aplaying definition level and playing smoothness, and then synchronizesthe key data to the playing policy control system. The playing policycontrol system can collect key data of large-scale users for comparativeanalysis, and adjust the video playing policy and the parameter of thecontrol algorithm based on a result of the comparative analysis.

For example, the playing policy control system may adjust the algorithmB and the parameter based on the result of data analysis, and determinean adjusted algorithm B and parameter values by using large-scale userplaying data. At the beginning, the invocation ratio of the algorithm Bcan be set to a low value to avoid unpredictable impacts on videoplaying, for example, key experience indicators such as the freeze rateand playing start delay. If the invocation ratio of the algorithm A tothe algorithm B is 9:1 at the beginning, the invocation ratio of thealgorithm B may be continuously increased subsequently, for example,8:2, 7:3, 5:5, 3:7, and 2:8. After the adjustment of the algorithm B andparameters takes effect, the video playing policy can be set to 2. Thatis, all videos are played through the algorithm B and parameters. If theadjustment of the algorithm B and parameters has no effect, a videoplaying policy 3 can be used in the current app version, that is, thedefault algorithm A and parameters of this version are used.

The following describes an adjustment effect of the control algorithm byusing an algorithm for flexibly adjusting the predicted bandwidth.

In the algorithm A, the predicted bandwidth is calculated through theharmonic average value. In the algorithm B, the predicted bandwidth iscalculated through the average value (and abnormal values are excluded).For a video playing initiated by a user, the predicted bandwidthscalculated by the algorithms A and B and attributes of a selected nextvideo slice (video segment) are shown in Table 1.

TABLE 1 Predicted Predicted bandwidth Slice bandwidth Slice SequenceReal-time by an downloading by an downloading number download algorithmresolution by an algorithm resolution by an of a slice Time (ms) rate(bps) A (bps) algorithm A B (bps) algorithm B  1 16:18:47.201 1987171219871712  720P (HD) 19871712  720P (HD)  2 16:18:48.646  164512  326322 270P (smooth) 10018112  480P (SD)  3 16:18:48.810 16226200  484610 270P (smooth) 12087475  720P (HD)  4 16:18:48.878 13468200  638489 270P (smooth) 12432656  720P (HD)  5 16:18:49.003 19247408  791547 270P (smooth) 17203380  720P (HD)  6 16:18:49.139 25840128  944073 480P (SD) 18930730  720P (HD)  7 16:18:49,228 27838360  1095228  480P(SD) 20415335 1080P (Blu-ray)  8 16:18:54.012 28740520  1244912  720P(HD) 21604647 1080P (Blu-ray)  9 16:18:58.443 20853432  1390152  720P(HD) 21510745 1080P (Blu-ray) 10 16:19:03.115  9925488  1520945  720P(HD) 20223494 1080P (Blu-ray) 11 16:19:09.665 24583616  1662752  720P(HD) 20659506 1080P (Blu-ray) 12 16:19:14.304 25880888  1803379  720P(HD) 21134177 1080P (Blu-ray) 13 16:19:19.103 17467920  1936996  720P(HD) 20828656 1080P (Blu-ray) 14 16:19:25.323 30867048  2075974 1080P(Blu-ray) 21600840 1080P (Blu-ray)

As shown in the foregoing table, when the algorithm A is used, if anabnormal download rate occurs, for example, the second download rate is164 kbps (caused by network jitter), the current and subsequentpredicted bandwidths are greatly affected. The predicted bandwidth istoo small than the actual bandwidth. As a result, the downloaded videoslices cannot be selected with high resolution for a long time. As shownin the foregoing table, four 270P video slices and two 480P video slicesare continuously downloaded due to the second abnormal download rate. Ifaverage duration of a video slice is 5 s, the user watches a smoothvideo for 20 s and an SD video for 10 s. After the first video slice,six video slices (30 s) are used to view a 720P HD video, and 13 videoslices (65 s) are used to view a 1080P Blu-ray video.

When the algorithm B is used, the predicted bandwidth is basically thesame as the actual bandwidth of the user. Network jitter mainly affectsthe download of the second video slice. Only one 480P video slice isdownloaded. That is, the user watches an SD video for 5 s. A 1080PBlu-ray video is displayed after six video slices (30 s). In the first30 s, a 720P HD video is displayed. It is clear that using the algorithmB greatly improves the video quality for the user, but compared withthat of the algorithm A, a probability of frame freezing is higher.After the quality indicator data is analyzed and the algorithm B andparameters of the algorithm B are dynamically adjusted, the optimalvideo viewing effect can be achieved by combining the video quality withthe playing start delay and zero freeze rate.

For step 808, the adjusted video playing policy may be updated to apolicy library for saving, so that the video playing policy can be usednext time.

Corresponding to the video playing control method described in theforegoing embodiments, FIG. 9 is a block diagram of a structure of avideo playing control system according to an embodiment of thisapplication. For ease of description, only a part related to thisembodiment of this application is shown.

Refer to FIG. 9 . The system includes a server 901 and a terminal device902.

The server 901 is configured to: after receiving a video playing requestsent by a terminal device, and send a video playing policy to theterminal device, where the video playing policy is used to determineinformation about a control algorithm used for current video playing:receive video playing quality index data uploaded by the terminaldevice, where the quality index data is collected and obtained by theterminal device in a process of downloading and playing a video; andadjust the video playing policy according to the quality indicator data.

The terminal device 902 is configured to: after receiving the videoplaying policy, determine, according to the video playing policy, atarget control algorithm used for current video playing; download andplay a video by using the target control algorithm; collect videoplaying quality indicator data in a process of downloading and playing avideo; and upload the quality indicator data to the server.

Further, the terminal device may be further configured to: obtain adevice type of the terminal device; select, according to the videoplaying policy, a control algorithm corresponding to the device typefrom a plurality of preset control algorithms as the target controlalgorithm.

Further, the terminal device may be further configured to: receive afirst control algorithm delivered by the server; determine a versionnumber of video playing software used for video playing: search locallyor from the server for a preset second control algorithm associated withthe version number; and select the target control algorithm from thefirst control algorithm and the second control algorithm according tothe video playing policy.

Further, the terminal device may be further configured to: obtain ahistorical record of each control algorithm used by the video playingsoftware to play a video; determine an invocation ratio of the firstcontrol algorithm according to the video playing policy; and select acontrol algorithm from the first control algorithm and the secondcontrol algorithm according to the historical record and the invocationratio as the target control algorithm.

Further, the terminal device may be further configured to upload thequality indicator data to the server, to indicate the server to adjustthe invocation ratio based on the quality indicator data.

Further, the terminal device may be further configured to: if the targetcontrol algorithm is the first control algorithm, upload the qualityindicator data to the server, to indicate the server to adjust the firstcontrol algorithm and parameters of the first control algorithmaccording to the quality indicator data.

Further, the terminal device may be further configured to: if the targetcontrol algorithm is the first control algorithm, and the qualityindicator data meets a preset condition, cancel an associationrelationship between the second control algorithm and the versionnumber, and associate the first control algorithm with the versionnumber.

Further, the terminal device may be further configured to uploadinformation about the selected target control algorithm to the server,so as to indicate the server to analyze the quality indicator data basedon the information about the selected target control algorithm; andgenerates a video playing quality indicator of the first controlalgorithm and a video playing quality indicator of the second controlalgorithm.

Further, the terminal device may be further configured to detect acurrent network download rate: if the network download rate exceeds afirst threshold, obtain a video segment that has been buffered in alocal buffer; and if the resolution of the buffered video segment isless than a second threshold and/or the bit rate is less than a thirdthreshold, download a video segment whose resolution is greater than orequal to the second threshold and/or the bit rate is greater than orequal to the third threshold in a same time period, and replace thebuffered video segment.

Further, the server may be further configured to: receive theinformation that is about the target control algorithm and that isuploaded by the terminal device; and analyze the quality indicator databased on the information about the target control algorithm, to generatea video playing quality indicator of the target control algorithm.

FIG. 10 is a schematic diagram of a structure of the video playingcontrol system in an actual application scenario.

In FIG. 10 , the video playing control system includes a server 1, aterminal device 2, and a CDN server 3. The server 1 includes a playingpolicy control system 1001, a quality analysis and monitoring system1002, and a video playing policy library 1003. The quality analysis andmonitoring system 1002 includes a playing quality analysis module 10021and a quality index data receiving module 10022. The terminal device 2includes a quality index data reporting module 2001, a playing controlmodule 2002, and a player module 2003.

An operating principle of the video playing control system is asfollows.

The administrator may set each video playing policy, and each controlalgorithm and parameter in the playing policy control system 1001, andmay store the set video playing policy in the video playing policylibrary 1003. When a video is played, the playing control module 2002 ofthe terminal device 2 first sends a request to the playing policycontrol system 1001 of the server 1, so as to obtain the video playingpolicy and a control algorithm that can dynamically adjust parameters.Then, the playing policy control system 1001 searches the video playingpolicy library 1003 for a video playing policy, and delivers the foundpolicy to the play control module 2002. Next, the play control module2002 determines a control algorithm and parameters to be used accordingto the received video playing policy, and configures the player module2003. Then, the player module 2003 downloads and plays the video fromthe CDN server 3 according to the configured algorithm and parameters.At a stage of starting, playing, and ending of the video playing, thequality index data reporting module 2001 collects quality index data ofthe current video playing and uploads the data to the quality analysisand monitoring system 1002. The quality analysis and monitoring system1002 receives data by using the quality index data receiving module10022, and sends the data to the playing quality analysis module 10021for data analysis. The playing quality analysis module 10021synchronizes a result of the data analysis to the playing policy controlsystem 1001, and then the playing policy control system 1001 may adjustthe delivered video playing policy according to the result of the dataanalysis, and further adjust the control algorithm or parameterscurrently used by the player module 2003, to achieve better videoplaying. Finally, the adjusted video playing policy may be stored in thevideo playing policy library 1003 for further use next time.

It should be noted that, the playing policy control system 1001, thequality analysis and monitoring system 1002, and the video playingpolicy library 1003 may be separately disposed in different servers, forexample, a playing policy server and an analysis and monitoring server,and the servers exchange data.

FIG. 11A and FIG. 11B are a schematic diagram of a service processingprocess of a video playing control system according to an embodiment ofthis application.

In a service processing flow shown in FIG. 11A and FIG. 11B, a defaultcontrol algorithm of a video app is an algorithm A, and an adjustablecontrol algorithm received from a play policy server is an algorithm B.The service processing flow is specifically as follows.

S111: an administrator sets a video playing policy, and an algorithm Band parameters on the playing policy server.

S112: When starting, the terminal app sends a policy obtaining requestto the playing policy server.

S113: The playing policy server returns the video playing policy, thealgorithm B and parameters to a terminal app.

S114: A user initiates playing of video content on the terminal app.

S115: The terminal app sends an authentication request for video playingto a video operation system.

S116: The video operation system authenticates the current videoplaying, and returns an authentication result to the terminal app.

S117: If an authentication result is successful, the terminal appdetermines, according to the video playing policy, a control algorithm(the algorithm A or algorithm B) and parameters that are set for aplayer.

S118: The terminal app downloads the to-be-played video data resourcefrom a CDN server by using the determined control algorithm andparameters.

S119: The terminal app receives the video data resource returned by theCDN server.

S120: The terminal app plays the video data resource.

S121: The terminal app reports quality index data of the current videoplaying and the used control algorithm to the analysis and monitoringserver.

S122: The analysis and monitoring server performs data analysis based onthe received quality indicator data uploaded by a large quantity ofusers, to obtain key data such as a video playing quality indicator ofthe A/B algorithm.

S123; The playing quality analysis and monitoring server synchronizesthe video playing quality index of the A/B algorithm to the playingpolicy server, which may be specifically synchronized by period (forexample, 12 hours).

S124: The playing policy server adjusts the video playing policyaccording to the video playing quality index of the A/B algorithm.

S125: The play policy server updates the adjusted video playing policyto a video playing policy library.

An embodiment of this application further provides a computer-readablestorage medium. The computer-readable storage medium stores a computerprogram. When the computer program is executed by a processor, steps ofthe video playing control method provided in this application areimplemented.

An embodiment of this application further provides a computer programproduct. When the computer program product runs on a terminal device,the terminal device is enabled to perform steps of each video playingcontrol method provided in this application.

FIG. 12 is a schematic diagram of a structure of a terminal deviceaccording to an embodiment of this application. As shown in FIG. 12 ,the terminal device 12 in this embodiment includes: at least oneprocessor 120 (only one processor is shown in FIG. 12 ), a memory 121,and a computer program 122 that is stored in the memory 121 and can runon the at least one processor 120. When executing the computer program122, the processor 120 implements steps in any of the foregoing videoplaying control method embodiments.

The terminal device 12 may be a computing device such as a desktopcomputer, a notebook computer, a palmtop computer, or a cloud server.The terminal device may include but is not limited to a processor 120and a memory 121. A person skilled in the art may understand that FIG.13 is merely an example of the terminal device 12, and does notconstitute a limitation on the terminal device 12. The terminal device12 may include more or fewer components than those shown in the figure,or combine some components, or different components. For example, thedevice may further include an input/output device, a network accessdevice, and the like.

The processor 120 may be a central processing unit (Central ProcessingUnit, CPU). The processor 120 may alternatively be anothergeneral-purpose processor, a digital signal processor (Digital SignalProcessor, DSP), an application-specific integrated circuit (ApplicationSpecific Integrated Circuit, ASIC), a field-programmable gate array(Field-Programmable Gate Array, FPGA) or another programmable logicdevice, a discrete gate or transistor logic device, or a discretehardware component. The general-purpose processor may be amicroprocessor, any conventional processor, or the like.

In some embodiments, the memory 121 may be an internal storage unit ofthe terminal device 12, for example, a hard disk or a memory of theterminal device 12. In some other embodiments, the memory 121 mayalternatively be an external storage device of the terminal device 12,for example, a removable hard disk, a smart media card (Smart MediaCard, SMC), a secure digital (Secure Digital, SD) card, a flash card(Flash Card), or the like that is equipped with the terminal device 12.Further, the memory 121 may alternatively include both an internalstorage unit and an external storage device of the terminal device 12.The memory 121 is configured to store an operating system, anapplication, a boot loader (BootLoader), data, and another program, forexample, program code of the computer program. The memory 121 mayfurther be configured to temporarily store data that has been output oris to be output.

It may be clearly understood by a person skilled in the art that, forconvenient and brief description, division of the foregoing functionunits and modules is merely used as an example for illustration. Inactual application, the foregoing functions can be allocated todifferent function units and modules and implemented based on arequirement, that is, an inner structure of the system is divided intodifferent function units and modules to implement all or some of thefunctions described above. Functional units and modules in theembodiments may be integrated into one processing unit, or each of theunits may exist alone physically, or two or more units may be integratedinto one unit. The integrated unit may be implemented in a form ofhardware, or may be implemented in a form of a software functional unit.In addition, specific names of the function units or modules are merelyprovided for distinguishing the units from one another, but are notintended to limit the protection scope of this application. For aspecific working process of the units or modules in the foregoingsystem, refer to a corresponding process in the foregoing methodembodiments. Details are not described herein again.

The foregoing descriptions are merely specific implementations of thepresent invention, but are not intended to limit the protection scope ofthe present invention. Any variation or replacement readily figured outby a person skilled in the art within the technical scope disclosed inthe present invention shall fall within the protection scope of thepresent invention. Therefore, the protection scope of the presentinvention shall be subject to the protection scope of the claims.

1. A video playing control method implemented by a terminal device,wherein the video playing control method comprises: obtaining a videoplaying policy that determines first information about a first controlalgorithm used for video playing; determining, according to the videoplaying policy, a target control algorithm used for the video playing;downloading and playing, using the target control algorithm, a video;collecting, in a process of downloading and playing the video, videoplaying quality indicator data; and uploading, to a server, the videoplaying quality indicator data, to instruct the server to adjust thevideo playing policy based on the video playing quality indicator data.2. The video playing control method of claim 1, further comprising:obtaining a device type of the terminal device; and selecting, accordingto the video playing policy and from a plurality of preset controlalgorithms, a second control algorithm corresponding to the device typeas the target control algorithm.
 3. The video playing control method ofclaim 1, further comprising: receiving, from the server, a secondcontrol algorithm; determining a version number of a video playingsoftware used for video playing; searching locally or from the server,for a preset third control algorithm associated with the version number;and selecting, from the second control algorithm and the preset thirdcontrol algorithm and according to the video playing policy, the targetcontrol algorithm.
 4. The video playing control method of claim 3,further comprising: obtaining a historical record of each controlalgorithm used by the video playing software to play a video;determining, according to the video playing policy, an invocation ratioof the second control algorithm; and selecting, from the second controlalgorithm and the preset third control algorithm and based on thehistorical record and the invocation ratio, a first control algorithm.5. The video playing control method of claim 4, further comprisingfurther uploading, to the server, the video playing quality indicatordata, to instruct the server to adjust the invocation ratio based on thevideo playing quality indicator data.
 6. The video playing controlmethod of claim 3, wherein after collecting the video playing qualityindicator data, the video playing control method further comprises:identifying that the target control algorithm is the second controlalgorithm; and further uploading, in response to identifying that thetarget control algorithm is the second control algorithm, the videoplaying quality indicator data to the server to instruct the server toadjust the second control algorithm and parameters of the second controlalgorithm based on the video playing quality indicator data.
 7. Thevideo playing control method of claim 3, wherein after collecting thevideo playing quality indicator data, the video playing control methodfurther comprises: identifying that the target control algorithm is thesecond control algorithm and the video playing quality indicator datameets a preset condition; cancelling, in response to identifying thatthe target control algorithm is the second control algorithm and thevideo playing quality indicator data meeting the preset condition, anassociation relationship between the preset third control algorithm andthe version number; and associating, in response to identifying that thetarget control algorithm is the second control algorithm and the videoplaying quality indicator data meeting the preset condition, the secondcontrol algorithm with the version number.
 8. The video playing controlmethod of claim 3, wherein after uploading the video playing qualityindicator data to the server, the video playing control method furthercomprises: uploading second information about the target controlalgorithm to the server to instruct the server to analyze the videoplaying quality indicator data based on the second information; andgenerating a first video playing quality indicator of the second controlalgorithm and a second video playing quality indicator of the presetthird control algorithm.
 9. The video playing control method of claim 1,wherein, in the process of downloading and playing the video, the videoplaying control method further comprises: detecting a current networkdownload rate; obtaining a first video segment that has been buffered ina local buffer when the network download rate exceeds a first threshold;and when a first resolution of the first video segment is less than asecond threshold or a first bit rate of the first video segment is lessthan a third threshold; downloading a second video segment comprising asecond resolution greater than or equal to the second threshold and asecond bit rate greater than or equal to the third threshold in a sametime period; and replacing the first video segment with the second videosegment.
 10. A video playing control method implemented by a server,wherein the video playing control method comprises: receiving, from aterminal device, a video playing request; sending, to the terminaldevice, a video playing policy instructing the terminal device todetermine, according to the video playing policy, a target controlalgorithm used for video playing and to download and play a video usingthe target control algorithm; receiving, from the terminal device, videoplaying quality indicator data based on downloading and playing a video;and adjusting, according to the video playing quality indicator data,the video playing policy.
 11. The video playing control method of claim10, further comprising: receiving, from the terminal device, informationabout the target control algorithm; and analyzing, based on theinformation, the video playing quality indicator data to generate avideo playing quality indicator of the target control algorithm.
 12. Aterminal device comprising: a memory configured to store instructions;and a processor coupled to the memory, wherein the instructions causethe processor to be configured to: obtain a video playing policy thatdetermines first information about a first control algorithm used forvideo playing; determine, according to the video playing policy, atarget control algorithm used for the video playing; download and play,using the target control algorithm, a video; collect, in a process ofdownloading and playing the video, video playing quality indicator data;and upload, to a server, the video playing quality indicator data toinstruct the server to adjust the video playing policy based on thevideo playing quality indicator data.
 13. (canceled)
 14. A computerprogram product comprising computer-executable instructions that arestored on a non-transitory computer-readable storage medium and that,when executed by a processor, cause a terminal device to: obtain a videoplaying policy that determines first information about a first controlalgorithm used for video playing; determine, according to the videoplaying policy, a target control algorithm used for the video playing;download and play, using the target control algorithm, a video; collect,in a process of downloading and playing the video, video playing qualityindicator data; and upload, to a server, the video playing qualityindicator data to instruct the server to adjust the video playing policybased on the video playing quality indicator data.
 15. The computerprogram product of claim 14, wherein the computer-executableinstructions further cause the terminal device to: obtain a device typeof the terminal device; and select, according to the video playingpolicy and from a plurality of preset control algorithms, a secondcontrol algorithm corresponding to the device type as the target controlalgorithm.
 16. The computer program product of claim 14, wherein thecomputer-executable instructions further cause the terminal device to:receive, from the server, a second control algorithm; determine aversion number of a video playing software used for video playing;search, locally or from the server, for a preset third control algorithmassociated with the version number; and select, from the second controlalgorithm and the preset third control algorithm and according to thevideo playing policy, the target control algorithm.
 17. The computerprogram product of claim 16, wherein the computer-executableinstructions further cause the terminal device to: obtain a historicalrecord of each control algorithm used by the video playing software toplay a video; determine, according to the video playing policy, aninvocation ratio of the second control algorithm; and select, from thesecond control algorithm and the preset third control algorithm andbased on the historical record and the invocation ratio, a first controlalgorithm.
 18. The computer program product of claim 17, wherein thecomputer-executable instructions further cause the terminal device tofurther upload, to the server, the video playing quality indicator datato instruct the server to adjust the invocation ratio based on the videoplaying quality indicator data.
 19. The computer program product ofclaim 16, wherein after collecting the video playing quality indicatordata, the computer-executable instructions further cause the terminaldevice to: identify that the target control algorithm is the secondcontrol algorithm; and further upload, in response to identifying thatthe target control algorithm is the second control algorithm, the videoplaying quality indicator data to the server to instruct the server toadjust the second control algorithm and parameters of the second controlalgorithm based on the video playing quality indicator data.
 20. Thecomputer program product of claim 16, wherein after collecting the videoplaying quality indicator data, the computer-executable instructionsfurther cause the terminal device to: identify that the target controlalgorithm is the second control algorithm and the video playing qualityindicator data meets a preset condition; cancel, in response toidentifying that the target control algorithm is the second controlalgorithm and the video playing quality indicator data meeting thepreset condition, an association relationship between the preset thirdcontrol algorithm and the version number; and associate, in response toidentifying that the target control algorithm is the second controlalgorithm and the video playing quality indicator data meeting thepreset condition, the second control algorithm with the version number.21. The computer program product of claim 16, wherein after uploadingthe video playing quality indicator data to the server, thecomputer-executable instructions further cause the terminal device to:upload second information about the target control algorithm to theserver to instruct the server to analyze the video playing qualityindicator data based on the second information; and generate a firstvideo playing quality indicator of the second control algorithm and asecond video playing quality indicator of the preset third controlalgorithm.